<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/12/28/028
 * Time: 17:09
 */

namespace app\portal\controller;


use cmf\controller\AdminBaseController;
use think\Db;

class AdminAppController extends AdminBaseController
{
    public function index()
    {
        
        $data = Db::name('app_address')->where('id','=',1)->find();
        $this->assign('data',$data);
        return $this->fetch();
    }
    /**
     * 修改大数据
     */
    public function editData()
    {
        if ( $this->request->isPost() ) {
            $data['an_address'] = input('post.an_address');
            $data['ios_address'] = input('post.ios_address');
            $result = Db::name('app_address')->where('id','=',1)->update($data);
            if ( $result ) {
                $this->success('修改成功!');
            }
            else {
                $this->error('修改失败');
            }
        } else {
            $this->error('提交的方式有误');
        }
    }
}